document.write('<script type="text/javascript" src="/js/jquery.flexslider-min.js"></script>');
$(document).ready(function() {
    $('.flexslider').flexslider({
        directionNav: true,
        pauseOnAction: false
    });
});
// ԭcommon.js
/* ����js */
$(function() {
    //  $("#nav_s li").first().addClass("nav_hover");
    //$(".nav_xl_1").hide();
    $("#nav_s li").hover(function() {
        $(this).addClass("nav_hover").siblings().removeClass("nav_hover").end().find(".nav_xl_1").stop(true, true).slideDown("fast").parent().siblings().find(".nav_xl_1").stop(true, true).slideUp("fast");
    }, function() {
        $(this).find(".nav_xl_1").stop(true, true).slideUp("fast");
        $(this).removeClass("nav_hover");
        $(".item_icon").find("i").hide();

        $(".nav_a1").removeClass("add_i");
        $(".nav_xl_son1").hide();
    })
    $(".item_icon").hover(function() {
        $(this).find("i").stop(true, true).show().end().siblings().find("i").stop(true, true).hide();
        $(".nav_xl_son1").eq($(this).index()).stop(true, true).show().siblings().stop(true, true).hide();
    })

    $(".nav_a1").hover(function() {
        $(this).addClass("add_i").siblings().removeClass("add_i");
    })


})


//��ҳ�˵���̬����λ��
function posTop(obj) {
    var Top = 0;
    while (obj) {
        Top += obj.offsetTop;
        obj = obj.offsetParent;
    }
    return parseInt(Top);
}
var _menudiv = document.getElementById('submenu').getElementsByTagName('div');

window.onscroll = function() {

    if (parseInt(document.documentElement.scrollTop || document.body.scrollTop) > posTop(document.getElementById('nav')) + 43) {

        $(".nav-submenu-xl").css("top", (parseInt(document.documentElement.scrollTop || document.body.scrollTop) - posTop(document.getElementById('submenu')) + 43) + "px");
    } else {
        $(".nav-submenu-xl").css("top", "42px");
    }
}

//��ҳ����Ч��
if (document.getElementById("submenu")) {
    var _submenu = $("#submenu").find('.submenu1');
    var _time = 100;

    function autoScrollDown() {
        if ($(".nav-submenu").css("height") == '0px') {
            if (!-[1, ] && !window.XMLHttpRequest) {
                $(".nav-submenu").css("height", "214px").find('.submenu1').eq(0).animate({
                    top: '0px'
                }, _time, function() {
                    _submenu.eq(1).css("top", "43px").animate({
                        top: '43px'
                    }, _time, function() {
                        _submenu.eq(2).css("top", "105px").animate({
                            top: '210px'
                        }, _time, function() {
                            _submenu.eq(3).css("top", "210px").animate({
                                top: '315px'
                            }, _time);
                        })
                    });
                });
            } else {
                $(".nav-submenu").css("height", "214px").find('.submenu1').eq(0).animate({
                    top: '0px'
                }, _time, function() {
                    _submenu.eq(1).css("top", "43px").animate({
                        top: '43px'
                    }, _time, function() {
                        _submenu.eq(2).css("top", "86px").animate({
                            top: '86px'
                        }, _time, function() {
                            _submenu.eq(3).css("top", "129px").animate({
                                top: '129px'
                            }, _time, function() {
                                _submenu.eq(4).css("top", "172px").animate({
                                    top: '172px'
                                }, _time)
                            });
                        })
                    });

                });
            }
        }
    }

    function autoScrollUp() {
        $(".nav-l").removeClass("nav-l-hover");
        $(".nav-submenu").css("height", "0px").find('.submenu1').stop().css("bottom", "0px");
        $(".nav-submenu-xl").hide().children('div').hide();
        _submenu.removeClass('submenu1-hover');
    }

    $(".nav-l").hover(function() {

        clearTimeout(_autoscroll);
        $(".nav-l").addClass("nav-l-hover");
        autoScrollDown();
    }, function() {
        autoScrollUp();
    });

    var _autoscroll = setTimeout(function() {
        autoScrollUp();
    }, 5000);



    _submenu.hover(function() {
        _submenu.removeClass('submenu1-hover').eq($(this).index()).addClass('submenu1-hover');
        $(".nav-submenu-xl").show().children('div').hide().eq($(this).index()).show();

    });
}


//��ʽ����
function hasClass(ele, cls) {
    return ele.className.match(new RegExp('(\\s|^)' + cls + '(\\s|$)'));
}

function addClass(ele, cls) {
    if (!this.hasClass(ele, cls)) {
        ele.className += " " + cls;
    }
}

function addClassname(elem, className) {
    if (!hasClass(elem, className)) {
        elem.className += ' ' + className;
    }
}

function removeClass(ele, cls) {
    if (hasClass(ele, cls)) {
        var reg = new RegExp('(\\s|^)' + cls + '(\\s|$)');
        ele.className = ele.className.replace(reg, ' ');
    }
}

function getByClass(oParent, iClass) {

    var aElem = oParent.getElementsByTagName('*');
    var reg = new RegExp('\\b' + iClass + '\\b', 'i');
    var reSult = [];

    for (var i = 0; i < aElem.length; i++) {
        if (reg.test(aElem[i].className)) {
            reSult.push(aElem[i]);
        }
    }
    return reSult;
}

function toggleClass(id, child) {
    var obj = document.getElementById(id).getElementsByTagName(child);
    var len = obj.length;
    for (var i = 0; i < len; i++) {
        obj[i].onmouseover = function() {
            if (this.className == "active") return;
            for (var i = 0; i < len; i++) {
                removeClass(obj[i], "active");
            }
            addClassname(this, "active");
        }
    }
}

function toggleClass2(id, child) {
    var obj = document.getElementById(id).getElementsByTagName(child);
    var len = obj.length;
    for (var i = 0; i < len; i++) {
        obj[i].onmouseover = function() {
            if (this.className == "active") return;
            for (var i = 0; i < len; i++) {
                removeClass(obj[i], "active");
            }
            addClassname(this, "active");
        }
        obj[i].onmouseout = function() {
            removeClass(this, "active");
        }
    }
}


// ������Ч��
function nTabs(thisObj, Num) {
    if (thisObj.className == "active") return;
    var tabObj = thisObj.parentNode.id;
    var tabList = document.getElementById(tabObj).getElementsByTagName("li");
    for (i = 0; i < tabList.length; i++) {
        if (i == Num) {
            addClassname(thisObj, "active");
            document.getElementById(tabObj + "_Content" + i).style.display = "block";
        } else {
            removeClass(tabList[i], "active");
            document.getElementById(tabObj + "_Content" + i).style.display = "none";
        }
    }
};

/* iframe���� */
function load_ifr(url) {
    //alert(url);
    $("#bigimg").attr("src", url);

    var windowW = $(window).width(); //��ȡ��ǰ���ڿ��
    var windowH = $(window).height(); //��ȡ��ǰ���ڸ߶�
    var imgWidth = 840;
    var imgHeight = 470;

    var w = (windowW - imgWidth) / 2; //����ͼƬ�봰����߾�
    var h = (windowH - imgHeight) / 2; //����ͼƬ�봰���ϱ߾�
    $("#innerdiv").css({
        "top": h,
        "left": w
    }); //����#innerdiv��top��left����
    $("#outerdiv").fadeIn("fast"); //������ʾ#outerdiv��.pimg
}

function load_ifr1(url) {
    //alert(url);
    $("#bigimg").attr("src", url);

    var windowW = $(window).width(); //��ȡ��ǰ���ڿ��
    var windowH = $(window).height(); //��ȡ��ǰ���ڸ߶�
    var imgWidth = 730;
    var imgHeight = 510;

    var w = (windowW - imgWidth) / 2; //����ͼƬ�봰����߾�
    var h = (windowH - imgHeight) / 2; //����ͼƬ�봰���ϱ߾�
    $("#innerdiv").css({
        "top": h,
        "left": w
    }); //����#innerdiv��top��left����
    $("#outerdiv").fadeIn("fast"); //������ʾ#outerdiv��.pimg
}

$("#outerdiv").click(function() { //�ٴε��������ʧ������
    $(this).fadeOut("fast");
});

// �����֤
function checkReg() {
    if (document.reg.name.value == " " || document.reg.name.value == null) {
        alert('��ʾ������д��������!');
        document.reg.name.focus();
        return false;
    }
    if (!checkName(document.reg.name.value)) {
        alert('��ʾ����������Ϊ2-4λ����!');
        return false;
    }
    if (document.reg.phone.value == " " || document.reg.phone.value == null) {
        alert('����д������ϵ�绰!');
        document.reg.phone.focus();
        return false;
    }
    if (!checkPhone(document.reg.phone.value)) {
        alert("������11λ�ֻ�����!");
        document.reg.phone.focus();
        return false;
    } else {

        var name = document.reg.name.value;
        var phone = document.reg.phone.value;
        var content = document.reg.content.value;
        var time = document.reg.time.value;
        var sex = document.reg.sex.value;

        $.post("/plus/diy.php", {
            name: name,
            phone: phone,
            time: time,
            content: content,
            sex: sex,
            active: 'post',
            diyid: '1',
            dede_fields: 'name,text;phone,text;time,text',
            doa: '2'
        }, function(data) {

            if (data == 'chenggong') {

                alert('����ԤԼ�ɹ����Ժ�ҽ�����绰������ϵ��');
            } else {

                alert('ԤԼʧ�ܣ�');
            }
        });

    }

};

function checkName(name) {
    var nameVar = /^([u4E00-u9FA5])*$/;
    if (!nameVar.test(name) && name.length >= 2 && name.length <= 4) {
        return true;
    } else {
        return false;
    }
};

function checkPhone(phone) {
    var flag = false;
    //var reg0 =  /^(([0\+]\d{2,3}-)?(0\d{2,3})-)?(\d{7,8})(-(\d{3,}))?$/;   //�ж� �̻�
    var reg1 = /^((\(\d{2,3}\))|(\d{3}\-))?(13|15|18)\d{9}$/; //�ж� �ֻ�
    //if (reg0.test(phone)) flag=true; 
    if (reg1.test(phone)) flag = true;
    return flag;
};
// footer.js

host = window.location.host;

if(host=='zx.mylikebj.com'){
	$(".pfhost").attr("href","http://pf.mylikebj.com");
}else if(host=='zx.mylike120.com'){
	$(".pfhost").attr("href","http://pf.mylike120.com");
}else if(host=='zx.mylikebj.cn'){
	$(".pfhost").attr("href","http://pf.mylikebj.cn");
}else if(host=='www.56935266.com' | host=='56935266.com'){
	$(".pfhost").attr("href","http://pf.56935266.cn");
}else if(host=='www.mylike.cn' | host=='mylike.cn'){
	$(".pfhost").attr("href","http://pf.mylike.cn");
}else if(host=='zx.bjml.com'){
	$(".pfhost").attr("href","http://pf.bjml.com");
}else{
	$(".pfhost").attr("href","http://pf.bjmylike.com");
}

if(host=='mylike120.com'){
	$("#shenji").html("[��������[2015]��0027��]");
}else if(host=='www.mylike120.com'){
	$("#shenji").html("[��������[2015]��0027��]");
}else{
	$("#shenji").html("[��������[2013]��0008��]");	
}

//�ٶ�ͳ��
if(host == 'zx.bjmylike.com'){
	var _hmt = _hmt || [];
	(function() {
	  var hm = document.createElement("script");
	  hm.src = "//hm.baidu.com/hm.js?2fd28355da785627dfb11e6d2c3a9ac8";
	  var s = document.getElementsByTagName("script")[0]; 
	  s.parentNode.insertBefore(hm, s);
	})();
}else if(host=='zx.mylike120.com'){
	var _hmt = _hmt || [];
	(function() {
	  var hm = document.createElement("script");
	  hm.src = "//hm.baidu.com/hm.js?299759309cd101454e9d69469d621ce0";
	  var s = document.getElementsByTagName("script")[0]; 
	  s.parentNode.insertBefore(hm, s);
	})();
}else if(host=='zx.mylikebj.cn'){
	var _hmt = _hmt || [];
	(function() {
	  var hm = document.createElement("script");
	  hm.src = "//hm.baidu.com/hm.js?035715c6aa7162df1b163d84e3973057";
	  var s = document.getElementsByTagName("script")[0]; 
	  s.parentNode.insertBefore(hm, s);
	})();
}else if(host=='zx.bjmylike.cn'){
	var _hmt = _hmt || [];
	(function() {
	  var hm = document.createElement("script");
	  hm.src = "//hm.baidu.com/hm.js?0f1254364d13c4812ee22902f3bdd1b1";
	  var s = document.getElementsByTagName("script")[0]; 
	  s.parentNode.insertBefore(hm, s);
	})();
}else if(host=='zx.mylikebj.com'){
	var _hmt = _hmt || [];
	(function() {
	  var hm = document.createElement("script");
	  hm.src = "//hm.baidu.com/hm.js?337ed1be92dea3835867b192f191ee4f";
	  var s = document.getElementsByTagName("script")[0]; 
	  s.parentNode.insertBefore(hm, s);
	})();
}


var isInitImg = false;
function initImg() {
	if(isInitImg) {
		return;
	}
	isInitImg = true;
	$.each($('img'),function(i, item) {
		var srcValue = $(item).data('src');
		if(srcValue) {
			$(item).attr('src', srcValue);
		}
	});
}
$('document').ready(function(){
	initImg();
});
// ĳЩfirefox������dom ready
setTimeout(function(){
	initImg();
},1500);

//ԭtjzj.js

//bannerЧ����װ
(function($) {
	$.fn.banner = function(o) {
		$.extend({
			time: 400,
			animStyle: true,
			addclass:addclass
		},
		o || {});
		var iNow = 0;
		var timer = null;
		var oDiv = $(this);
		var oUl = oDiv.children('ul');
		var aLi = $('li', oUl);
		var oneSize = aLi.eq(0).width();
		var animStyle = o.animStyle ? 'left': 'opacity';
		var addclass=o.addclass;
		//alert(oneSize);
		var time = o.time;
		oDiv.css({
			'position': 'relative'
		});
		$('<div class="banner_index"><ul></ul></div>').appendTo(oDiv);
		var bannerIndex = $('.banner_index ul', oDiv);

		aLi.each(function(i) {
			if (animStyle == 'opacity') {
				if ($(this).index() == 0) {
					$(this).css({
						'opacity': 1,
					});
				
				} else {
					$(this).css({
						'opacity': 0
					});
					
				}
				$(this).css({
					'position': 'absolute',
					'left': 0,
					'top': 0
				});
			} else {
				oUl.css({
					'width': oneSize * aLi.size(),
					'position': 'absolute',
					'left': 0
				});
			}
			$('<li></li>').appendTo(bannerIndex);
			//console.log(oDiv.width() + '||' + $(this).index() + '||' + oneSize);

		});


	    /* $('li', bannerIndex).addClass("on111"); */

		$('li', bannerIndex).eq(iNow).addClass("on111");
        			
		aLi.eq(iNow).addClass(addclass);
		
		var _this = aLi;
		function fnNext(iNow) {
			_this.eq(iNow).addClass(addclass).siblings('li').removeClass(addclass);
			
			$('li', bannerIndex).eq(iNow).addClass("on111").siblings('li').removeClass("on111");
			
			
			if (!o.animStyle) {
				for (var i = 0; i < _this.length; i++) {
					if (i > iNow) {
						_this.eq(i).stop(true, true).animate({
							'opacity': 0,
							'z-index':0,
						},
						time);
					} else if (i < iNow) {
						_this.eq(i).stop(true, true).animate({
							'opacity': 0,
							'z-index':0,
						},
						time);
					} else {
						_this.eq(i).stop(true, true).animate({

							'opacity': 1,
							'z-index':1,
						},
						time);
					}
				}
			} else {
				oUl.stop().animate({
					'left': -iNow * oneSize
				});
			}

		}

		timer = setInterval(function() {
			if (iNow == _this.length - 1) {
				iNow = 0
			} else {
				iNow++;

			}
			fnNext(iNow);
		},
		7000);

		$('li', bannerIndex).each(function() {

			$(this).mouseover(function() {
				clearInterval(timer);
				iNow = $(this).index();
				fnNext(iNow);				
				
			});
			$(this).mouseout(function() {	
				clearInterval(timer);
				timer = setInterval(function() {
					if (iNow == _this.length - 1) {
						iNow = 0
					} else {
						iNow++;

					}
					fnNext(iNow);
				},
				7000);
			});

		});
	}
})(jQuery);




$(function() {
	//������Ŀbanner
	$('.object_banner1').banner({time:600,animStyle:true});
	$('.object_banner2').banner({time:600,animStyle:true});
	$('.object_banner3').banner({time:600,animStyle:true});
	$('.object_banner4').banner({time:600,animStyle:true});
	$('.object_banner5').banner({time:600,animStyle:true});
	//ר��
	$('.focuszjimg').banner({time:400,animStyle:false});
	//�Żݻ
	$('.focuszjimg1').banner({time:400,animStyle:false});
	
	$("#hot_qCon li").not(":first").find(".answer,.p2").hide();
	$("#hot_qCon li").first().css("padding-bottom","10px");
	$("#hot_qCon li").mouseover(function(){
			$(this).css("padding-bottom","10px").find(".answer,.p2").show().end().siblings().find(".answer,.p2").hide();
		})
		
})
/*��������*/
var timer = setInterval(function(){
	if($("#qiao-wrap").length){
		$("#qiao-wrap").hide();
		clearInterval(timer);
	}
}, 500);

/*����ͨ��������*/
function swtClick(){
	openZoosUrl();
	LR_HideInvite();
	return false;
}

